package info.unclewang.bert.support.run;

import com.google.common.util.concurrent.ThreadFactoryBuilder;
import info.unclewang.bert.support.dao.SemanticScholarService;

import java.util.concurrent.*;

public class SSRun {
	private static Long intervalNum = 200000L;

	public static void main(String[] args) {
		ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("s2-%d").build();

		ExecutorService pool = new ThreadPoolExecutor(10, 20, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1024), threadFactory);

		for (int i = 0; i < 10; i++) {
			SemanticScholarService semanticScholarService = new SemanticScholarService(i * intervalNum);
			pool.execute(semanticScholarService);
		}

		pool.shutdown();
	}
}
